package org.sunflower.rabbit;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Arrays;

/**
 * @description:
 * @author: TanJingyu
 * @create: 2021-10-14 14:42
 **/
@Component
@RabbitListener(queues = "test")
public class SendMessageHandler {

    @RabbitHandler
    public void sendMessage(Sms sms) {
//        MessageProperties properties = message.getMessageProperties();
//        System.out.println(properties.getConsumerTag());
//        System.out.println(properties.getDeliveryTag());
//        System.out.println(properties.getCorrelationId());
//        System.out.println(properties.getAppId());
//        System.out.println(properties.getConsumerQueue());
//        System.out.println(properties.getClusterId());
//        System.out.println(properties.getContentEncoding());
//        System.out.println(properties.getContentType());
//        System.out.println(properties.getDelay());
//        System.out.println(properties.getDeliveryMode());
//        System.out.println(properties.getHeaders());
//
//
//        System.out.println(new String(message.getBody()));

        System.out.println(sms);
    }
}
